/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author kheirarahali
 */
@Entity
@Table(name = "ProductStore")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProductStore.findAll", query = "SELECT p FROM ProductStore p"),
    @NamedQuery(name = "ProductStore.findByReference", query = "SELECT p FROM ProductStore p WHERE p.reference = :reference"),
    @NamedQuery(name = "ProductStore.findByNom", query = "SELECT p FROM ProductStore p WHERE p.nom = :nom"),
    @NamedQuery(name = "ProductStore.findByDescription", query = "SELECT p FROM ProductStore p WHERE p.description = :description"),
    @NamedQuery(name = "ProductStore.findByIban", query = "SELECT p FROM ProductStore p WHERE p.iban = :iban")})
public class ProductStore implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "reference")
    private Integer reference;
    @Size(max = 45)
    @Column(name = "nom")
    private String nom;
    @Size(max = 45)
    @Column(name = "description")
    private String description;
    @Size(max = 45)
    @Column(name = "IBAN")
    private String iban;

    public ProductStore() {
    }
    public ProductStore (int reference, String nom, String description, String iban) {
        this.reference = reference;
        this.nom = nom;
        this.description = description;
        this.iban = iban;
    }
    
    public ProductStore(Integer reference) {
        this.reference = reference;
    }

    public Integer getReference() {
        return reference;
    }

    public void setReference(Integer reference) {
        this.reference = reference;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getIban() {
        return iban;
    }

    public void setIban(String iban) {
        this.iban = iban;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (reference != null ? reference.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProductStore)) {
            return false;
        }
        ProductStore other = (ProductStore) object;
        if ((this.reference == null && other.reference != null) || (this.reference != null && !this.reference.equals(other.reference))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.ProductStore[ reference=" + reference + " ]";
    }
    
}
